string

Section: OATH Reference Manual (3O)
Updated: 26 August 1991
Index Return to Main Contents
 

NAME

string (stringA, stringG) - a character list  

SYNOPSIS

#include <oath/string.h>  

DESCRIPTION

The string is a list that only holds characters. If an obj other than a character is inserted into a string, it will simply "fall through". Additional functionality appropriate for lists of characters is available. The stringPos is a companion class that represents a position in a string.  

DERIVATION

string : list : deq : fifoQueue : seq : queue : bag : obj

string is an abstract type.  

STATIC OPERATIONS

stringA stringA:: isa (objA)
stringA::isa(O) returns O if it is truly a string; otherwise it returns Nil.
 

MEMBER OPERATIONS

stringPosA stringA:: makePos (int = 0, int = FALSE)
L.makePos(I) makes and returns a stringPos that indicates the I'th position in string L (I=0 is the first position). If the last argument is TRUE, then the new stringPos is const.
characterA stringA:: operator [] (int)
S[I] returns the I'th character in string S.
characterA stringA:: operator [] (stringPosA)
S[P] returns the character in front of pos P in string S.
int stringA:: isEqual (const char*)
S.isEqual(C) returns non-zero if the char * C contains the same character values as the string S.
int stringA:: isEqual (stringPosA, stringPosA)
S.isEqual(Start, Beyond) returns non-zero if the characters between the stringPos Start and Beyond are the same as those in the string S.
int stringA:: isEqualAnyCase (stringA)
S1.isEqualAnyCase(S2) is the same as S1.isEqual(S2), except case insensitive.
int stringA:: isEqualAnyCase (const char*)
S.isEqualAnyCase(C) is the same as S.isEqual(C), except case insensitive.
int stringA:: isEqualAnyCase (stringPosA, stringPosA)
S.isEqualAnyCase(Start, Beyond) is the same as S.isEqual(Start, Beyond), except case insensitive.
int stringA:: operator <= (stringA)
int stringA:: operator < (stringA)
int stringA:: operator > (stringA)
int stringA:: operator >= (stringA)
const char* stringA:: charStar ()
S.charStar() returns a null-terminated char* containing the values of the characters in string S, up to the first NUL.
void stringA:: charStarX (char *, int)
S.charStar(C, N) will write up to N of the character values in S into the char* buffer C.
int stringA:: hash (int)
S.hash(K) returns a positive int computed from S using hashing parameter K. For hashing, the returned value should be modulo'd to the desired size. For example, int HashValue = S.hash(K) % 255;.
int stringA:: hash ()
S.hash() is the same as S.hash(4), but implemented more efficiently. The best distributions will be obtained if the modulo value is odd. For example, int HashValue = S.hash() % 255;.
int stringA:: hashLower (int)
S.hashLower(K) is the same as S.hash(K) except that it hashes uppercase letters as if they were lowercase.
int stringA:: hashLower ()
S.hashLower() is the same as S.hash() except that it hashes uppercase letters as if they were lowercase.
int stringA:: hashUpper (int)
S.hashUpper(K) is the same as S.hash(K) except that it hashes lowercase letters as if they were uppercase.
int stringA:: hashUpper ()
S.hashUpper() is the same as S.hash() except that it hashes lowercase letters as if they were uppercase.
stringA stringA:: applyX (characterA (*)(characterA), stringA)
S1.applyX(F, S2) takes each character in S1, passes it to F (a function taking a characterA), and inserts the resulting character into the string S2; then it returns S2.
stringA stringA:: applyX (stringA (*)(characterA), stringA)
S1.applyX(F, S2) takes each character in S1, passes it to F (a function taking a characterA), and inserts each of the characters in the resulting string into the string S2; then it returns S2.
stringA stringA:: make (characterA (*)(characterA))
S.make(F) is the same as S.applyX(F, S.makeEmpty()).
stringA stringA:: make (stringA (*)(characterA))
S.make(F) is the same as S.applyX(F, S.makeEmpty()).
stringA stringA:: lowercase ()
S.lowercase() converts all uppercase letters to lowercase.
stringA stringA:: uppercase ()
S.uppercase() converts all lowercase letters to uppercase.
stringA stringA:: makeLower (int = FALSE)
S.makeLower() is the same as (+S).lowercase(), except that if the parameter is TRUE, then the new string will be const.
stringA stringA:: makeUpper (int = FALSE)
S.makeUpper() is the same as (+S).uppercase(), except that if the parameter is TRUE, then the new string will be const.
stringA stringA:: operator << (objA)
S << C inserts character C at the end of string S and returns S. If C is not a character, then it will fall through.
stringA stringA:: operator << (char)
S << C makes a character from char C and inserts it at the end of string S, and then returns S.
stringA stringA:: operator << (bagA)
S1 << S2 inserts each character in bag S2 into the string S1 and returns S1. If S2 contains any non-characters, then they will fall through.
stringA stringA:: operator << (const char*)
S1 << S2 makes a character from each char in the null-terminated char* S2 and inserts each character into the string S1, and then returns S1.
ostream& operator << (ostream&, stringA)
F << S puts each character value of string S to into ostream F and returns F.
istream& operator >> (istream&, stringA)
F >> S gets every character from istream F and inserts each into string S, and then returns F.
 

INTERNAL OPERATIONS

virtual int stringG:: isEqual (const char*)
virtual int stringG:: isEqual (const stringPosG*, const stringPosG*)
virtual int stringG:: isEqualAnyCase (const char*)
virtual int stringG:: isEqualAnyCase (const stringPosG*, const stringPosG*)
virtual int stringG:: lessThan (const stringG*)
virtual int stringG:: moreThan (const stringG*)
virtual void stringG:: stringInsert (const characterG*)
virtual void stringG:: stringInsert (char)
virtual void stringG:: stringAppend (const stringG*)
virtual void stringG:: stringAppend (const char*)
virtual const char* stringG:: charStar () const
virtual void stringG:: charStarX (char* C, int N) const
virtual int stringG:: hash () const
virtual int stringG:: hash (int) const
virtual int stringG:: hashLower () const
virtual int stringG:: hashLower (int) const
virtual int stringG:: hashUpper () const
virtual int stringG:: hashUpper (int) const
virtual stringG* stringG:: applyStringX (characterA (*)(characterA), stringG*) const
virtual stringG* stringG:: applyStringX (stringA (*)(characterA), stringG*) const
virtual void stringG:: lowercase ()
virtual void stringG:: uppercase ()
virtual stringA stringG:: makeLower (int) const
virtual stringA stringG:: makeUpper (int) const
virtual ostream& stringG:: ostreamInsertion (ostream&) const
virtual istream& stringG:: istreamExtraction (istream&)
static int stringG:: hash (const char*)
static int stringG:: hash (const stringPosG*, const stringPosG*)
static int stringG:: hashLower (const char*)
static int stringG:: hashLower (const stringPosG*, const stringPosG*)
static int stringG:: hashUpper (const char*)
static int stringG:: hashUpper (const stringPosG*, const stringPosG*)
 

SEE ALSO

OATH(3O), list(3O), stringPos(3O), character(3O)  

AUTHOR

Brian M. Kennedy (Computer Science Center, Texas Instruments Incorporated)  

BUGS


 

Index

NAME
SYNOPSIS
DESCRIPTION
DERIVATION
STATIC OPERATIONS
MEMBER OPERATIONS
INTERNAL OPERATIONS
SEE ALSO
AUTHOR
BUGS

This document was created by man2html, using the manual pages.
Time: 00:37:22 GMT, March 30, 2022